import * as TYPES from "../action-types";
import { getHotAlbums, getTopAlbums } from "services/albums";

let actions = {
  getHotAlbums: async () => {
    const res = await getHotAlbums();
    return {
      type: TYPES.HOT_ALBUMS,
      payload: res.albums,
    };
  },
  getTopAlbums: async ({ limit = 10, offset = 1 } = {}) => {
    const res = await getTopAlbums({ limit, offset });
    return {
      type: TYPES.TOP_ALBUMS,
      payload: res,
    };
  },
};

export default actions;
